/*
 * Main.java
 *
 * Created on March 27, 2007, 4:30 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package ai9hells.pgaibe.chapter2.westworldwithmessaging;


/**
 *
 * @author andre.bandarra
 */
public class Main {
    
    /** Creates a new instance of Main */
    public Main() {
    }
    public static void main(String[] args){
        Miner m = new Miner(EntityNames.MINER_BOB);
        MinersWife mw = new MinersWife(EntityNames.ELSA);        
        EntityManager.INSTANCE.registerEntity(m);
        EntityManager.INSTANCE.registerEntity(mw);        
        for (int i=0; i< 30; i++){
            m.update();
            mw.update();
            MessageDispatcher.INSTANCE.dispatchDelayedMessages();
            try{
                Thread.currentThread().sleep(800);
            } catch(InterruptedException ie){}
        }
        System.exit(0);
    }
    
}
